<?php
class Ranking extends RankingsAppModel {

	var $name = 'Ranking';
	var $validate = array(
		'title' => array('notempty'),
		'pos_1' => array('notempty'),
		'pos_2' => array('notempty'),
		'pos_3' => array('notempty')
	);
	
	function get_ranking(){
		$rank = $this->find('first',array('order' => 'Ranking.id DESC'));
		$rank['Ranking']['pos_1'] = explode(',',$rank['Ranking']['pos_1']);
		$rank['Ranking']['pos_2'] = explode(',',$rank['Ranking']['pos_2']); 
		$rank['Ranking']['pos_3'] = explode(',',$rank['Ranking']['pos_3']); 
		$rank['Ranking']['pos_4'] = explode(',',$rank['Ranking']['pos_4']); 
		$rank['Ranking']['pos_5'] = explode(',',$rank['Ranking']['pos_5']); 
		$rank['Ranking']['pos_6'] = explode(',',$rank['Ranking']['pos_6']); 
		$rank['Ranking']['pos_7'] = explode(',',$rank['Ranking']['pos_7']); 
		$rank['Ranking']['pos_8'] = explode(',',$rank['Ranking']['pos_8']); 
		$rank['Ranking']['pos_9'] = explode(',',$rank['Ranking']['pos_9']); 
		$rank['Ranking']['pos_10'] = explode(',',$rank['Ranking']['pos_10']); 
		return $rank;
		
		
	}
}
?>